package me.yxy.mobanddd.controller.response;

/**
 * Command操作后共用返回结果
 */
public class QueryResponse {

    /**
     * 除0以外，其余均为异常
     */
    private String code = "0";

    /**
     *
     */
    private String msg = "操作成功";

    private Object data;


    public QueryResponse(Object data) {
        this.data = data;
    }

    public QueryResponse(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public static QueryResponse ok(Object data){
        return new QueryResponse(data);
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
